Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test with custom install dir #10048

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

1hakusai1
Copy link

Summary

Testing with UV_PYTHON_INSTALL_DIR environment variable has some problems. This PR fix them.

  • UV_PYTHON_INSTALL_DIR must be an absolute path.
    • Cargo tries to find Python executables from each crates in test. If it is relative path, cargo searches in different directories for each tests.
  • Skip the test asserting help messages.
    • Clap shows the current value of the environment variables. If UV_PYTHON_INSTALL_DIR is set, the test fails.

Test Plan

All tests pass with UV_PYTHON_INSTALL_DIR=/path/to/my/home/uv/target/testpython.

@1hakusai1
Copy link
Author

One test fails, but it seems not to be related to this change.

Comment on lines 455 to 458
if env::var("UV_PYTHON_INSTALL_DIR").is_ok() {
// skip this test
return;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note, you can use instead

uv_snapshot!(context.filters(), context.help().env_remove(EnvVars::UV_PYTHON_INSTALL_DIR).arg("python").arg("install"), @r###"

@samypr100 samypr100 added the documentation Improvements or additions to documentation label Dec 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants